#pragma once

#include <qbprotocol/include/SSFilters.h>

#include <QFrame>

#include "../Filter/EnviFilter.h"

class RealDealTable;
class STabCtrl;
class BestQuoteDlg;
class SImageButton;
class BestQuoteDeal : public QFrame {
  Q_OBJECT
 public:
  BestQuoteDeal(BestQuoteDlg* parent);
  void setCollapsed(bool v);

 signals:
  void collapsed(bool v);

 public slots:
  void onBrokerTabChanged(int index);
  void onBrokerTabChanged2(int index);
  void onFilterChange();

 protected:
  void initUi();
  void changeParam(int brokerId, int nType, void* pFilter, bool bShowAll);
  void changeBroker();
  void paintEvent(QPaintEvent*) override;

 private:
  STabCtrl* m_brokerTab = nullptr;
  RealDealTable* m_table = nullptr;
  BestQuoteDlg* m_pParent = nullptr;
  SImageButton* m_collapseBtn = nullptr;
  CEnviFilter m_envi;
  BLHCONDITION m_blh;
  bool m_collapsed = false;
};